function myCallBack(data) {
    var fields = ata.list.resources[0].resource.fields
    document.getElementById("name").innerHTML = fields.name;
    document.getElementById("price").innerHTML = fields.price;
    document.getElementById("symbol").innerHTML = fields.symbol;
    document.getElementById("typeofstock").innerHTML = fields.type;
    document.getElementById("volume").innerHTML = fields.volume;
}

//appends script to execute callback with data form yahoo
document.getElementById('sumbitButton').onclick = stuff
function stuff(e) {
    console.log('something')
    var textValue = document.getElementById("stockTextBox").value,
        script = document.createElement('script');
    script.src = 'http://finance.yahoo.com/webservice/v1/symbols/' +
        textValue + '/quote?format=json&callback=myCallBack';

    document.body.appendChild(script);
    console.log("dun");
}
